
target_include_directories(${PROJECT_NAME} 
    PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/components/finsh
    PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include
    PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})


aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/components/device rtthread_nano_components_device)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/components/finsh rtthread_nano_components_finsh)
target_sources(${PROJECT_NAME} 
    PRIVATE ${rtthread_nano_components_device}
    PRIVATE ${rtthread_nano_components_finsh})

# append rtthread libcpu source files 
file(GLOB arm_common_src ${CMAKE_CURRENT_SOURCE_DIR}/libcpu/arm/common/*.c)

list(APPEND arm_common_cortex_m7_src
     ${CMAKE_CURRENT_SOURCE_DIR}/libcpu/arm/cortex-m7/context_gcc.S
     ${CMAKE_CURRENT_SOURCE_DIR}/libcpu/arm/cortex-m7/cpu_cache.c
     ${CMAKE_CURRENT_SOURCE_DIR}/libcpu/arm/cortex-m7/cpuport.c)

target_sources(${PROJECT_NAME} 
    PRIVATE ${arm_common_src}
    PRIVATE ${arm_common_cortex_m7_src})

# append rtthread src 
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/src rtthread_nano_src)
target_sources(${PROJECT_NAME}
    PRIVATE ${rtthread_nano_src})
